package com.ititer.dao.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.ititer.dao.ProfileDao;
import com.ititer.mapper.ProfileMapper;
import com.ititer.model.Profile;

@Repository
public class ProfileDaoImpl implements ProfileDao {

	@Autowired
	private ProfileMapper mapper;

	@Override
	public Profile getById(Integer id) {
		return mapper.selectByPrimaryKey(id);
	}

	@Override
	public boolean update(Profile profile) {
		int result = mapper.updateByPrimaryKey(profile);
		return result == 1 ? true : false;
	}

	@Override
	public boolean insert(Profile profile) {
		int result = mapper.insert(profile);
		return result == 1 ? true : false;
	}

}
